import 'package:flutter/material.dart';

class MyIcon extends StatelessWidget {
  final Icon icon;

  final Color color;

  MyIcon({@required this.icon, @required this.color});

  @override
  Widget build(BuildContext context) {
    final theme = IconTheme.of(context);
    return Stack(
      children: <Widget>[
        icon,
        Positioned(
          child: Offstage(
              offstage: color == null ? true : false,
              child:
                  CircleAvatar(radius: theme.size / 5, backgroundColor: color)),
          right: 2,
        )
      ],
    );
  }
}
